package cn.base.project.Test;

import cn.base.project.exception.custom.BaseException;
import cn.base.project.exception.custom.code.ErrorCode;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by Linwq on 2017/12/20.
 */
@Controller
public class TestController {

    @RequestMapping("/")
    public String index(){

        return "index";
    }
    @RequestMapping("/test")
    @ResponseBody
    public String test()throws Exception{
        throw new BaseException(ErrorCode.FRONT_END_DATA_ERROR);
    }
}
